Extract ResolverFactory from PolarisEntityManager#2148
Merged
snazy merged 2 commits intoapache:mainfrom Jul 23, 2025
Merged
Conversation
dimas-b
reviewed
Jul 21, 2025
Contributor
dimas-b
left a comment
There was a problem hiding this comment.
This PR LGTM as a general refactoring to isolate resolver lifecycle concerns into a dedicated factory.
8a61fb9 to
f4ce8f7
Compare
`PolarisEntityManager.prepareResolver` was the only place that used the `EntityCache`. By introducing an application-scoped `ResolverFactory` the creation of an `EntityCache` is decided only once in `QuarkusProducers`, which will become the only place where `MetaStoreManagerFactory.getOrCreateEntityCache` gets called. Note that the little left-over functionality of `PolarisEntityManager` can be split out to more dedicated interfaces in a follow-up most likely.
f4ce8f7 to
e7ff61e
Compare
snazy
reviewed
Jul 22, 2025
polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisEntityManager.java
Outdated
Show resolved
Hide resolved
| */ | ||
| public PolarisEntityManager( | ||
| @Nonnull PolarisMetaStoreManager metaStoreManager, @Nullable EntityCache entityCache) { | ||
| @Nonnull PolarisMetaStoreManager metaStoreManager, @Nonnull ResolverFactory resolverFactory) { |
Member
There was a problem hiding this comment.
Nit:
Suggested change
| @Nonnull PolarisMetaStoreManager metaStoreManager, @Nonnull ResolverFactory resolverFactory) { | |
| @Nonnull PolarisMetaStoreManager metaStoreManager, ResolverFactory resolverFactory) { |
We kind-of agreed that parameters a not-null by default. But I don't mind having it explicit.
Contributor
Author
There was a problem hiding this comment.
while i agree that assuming non-null would be the best default it would seem weird to have only 1 of the parameters annotated like that.
also it would be unjustified to remove the annotation from the 1st parameter as part of this PR, so i add it to the 2nd parameter for consistency.
long term we should starting using https://jspecify.dev/docs/applying/#2-add-nullmarked
snazy
approved these changes
Jul 22, 2025
dimas-b
approved these changes
Jul 22, 2025
snazy
added a commit
to snazy/polaris
that referenced
this pull request
Nov 20, 2025
* Extract ResolverFactory from PolarisEntityManager (apache#2148) `PolarisEntityManager.prepareResolver` was the only place that used the `EntityCache`. By introducing an application-scoped `ResolverFactory` the creation of an `EntityCache` is decided only once in `QuarkusProducers`, which will become the only place where `MetaStoreManagerFactory.getOrCreateEntityCache` gets called. Note that the little left-over functionality of `PolarisEntityManager` can be split out to more dedicated interfaces in a follow-up most likely. * Run standard (sharable) REST Catalog integrations tests with MinIO (apache#2158) * Run standard (sharable) REST Catalog integrations tests with MinIO Keep special edge case tests (path style, STS endpoint and client-side FileIO) in `QuarkusRestCatalogMinIoSpecialIT`. * fix(deps): update quarkus platform and group (apache#2166) * fix(deps): update dependency io.smallrye.config:smallrye-config-core to v3.13.4 (apache#2165) * Simplify checkPolarisServiceBootstrappedForRealm (apache#2162) * fix(deps): update dependency boto3 to v1.39.12 (apache#2169) * Improve Realm ID resolution for Quarkus 3.24+ (apache#2163) In Quarkus 3.24, it is now possible to retrieve context locals inside HttpServerMetricsTagsContributor. This greatly simplifies our RealmIdTagContributor implementation. It is also now possible to return null from ValueExpressionResolver. This is not a big deal, but still better than returning "". * chore(deps): update plugin jandex to v2.2.0 (apache#2175) * Add muti-platform Docker images staging in the release guide (apache#2039) * fix(deps): update dependency org.apache.commons:commons-text to v1.14.0 (apache#2178) * Rework getOrCreateSessionSupplier (apache#2161) note how all the caller immediately called `get` on the returned `Supplier`. it seems like the `Supplier` was an leaking implementation detail of the `MetaStoreManagerFactor` implementations. * Respond with 409 in case of concurrent Namespace update failures instead of 500 (apache#1989) * NoSQL adoptions * Last merged commit e9267b6 --------- Co-authored-by: Christopher Lambert <[email protected]> Co-authored-by: Dmitri Bourlatchkov <[email protected]> Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: Alexandre Dutra <[email protected]> Co-authored-by: JB Onofré <[email protected]> Co-authored-by: fabio-rizzo-01 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PolarisEntityManager.prepareResolverwas the only place that used theEntityCache.By introducing an application-scoped
ResolverFactorythe creation ofan
EntityCacheis decided only once inQuarkusProducers, which will becomethe only place where
MetaStoreManagerFactory.getOrCreateEntityCachegets called.Note that the little left-over functionality of
PolarisEntityManagercanbe split out to smaller but more dedicated interfaces in a follow-up most likely.